import rsa

import base64

pk=b"""-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAskdYuP+H/wwvwfoxpO9ub+GyaDyOgibAfA4dm7ARXvcI9MY/DZ/P
zrBXhpHP7oO+yKeD5dTHpGybfjn78mQzFiT6IeHxBUso9gXdWyFnaLx3Cea/TPBO
sNjDG/DWz1hF3sAukbwO1c/s9oozUiGX9GS2LKtLtEI1mzXofrj2mBCowGzWaAsm
jw7W+S80hE5He0ezGg7p2n4sUFf6k+ilYZQMPemMHkzUnn1Xzl2skNZZgu8v3A68
8XkQDx6yT9IM3QTowic3llB1oTwhOYv2hfxdEhi27cuWqS/ezMkfChjEqBIPp5KP
NMBvjfkS9tCtJYV3wDNTBsn6rp9Aw9NT1QIDAQAB
-----END RSA PUBLIC KEY-----"""

public_key = rsa.PublicKey.load_pkcs1(pk)

message = b"admin"

ciphertext = rsa.encrypt(message, public_key)

b64 = base64.b64encode(ciphertext)
print('ciphertext:%s' % ciphertext)
print('b64:%s' % b64)
